import javax.swing.JFileChooser;
import javax.swing.JFrame;
import java.util.Properties;
import java.io.*;
import java.net.*;

	public class RetrieveDir{

 public static String getDir(){
	JFileChooser fileChooser = null;

 	String dir = "" ;
	fileChooser = new JFileChooser();
    fileChooser.setCurrentDirectory(new java.io.File("."));
    fileChooser.setDialogTitle(dir);
    fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    //
    // disable the "All files" option.
    //
    fileChooser.setAcceptAllFileFilterUsed(false);
    
    
    if (fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
      dir = fileChooser.getSelectedFile().toString();
      }

     return dir;
     }
	}